// 空间图标配置系统
// 使用Lucide React图标库，提供现代化、一致性的图标体验
// 分类组织图标，方便用户选择和开发维护

import {
    // 工作与项目类
    Briefcase, FolderOpen, Folder, Archive, FileText, Layers, Target,
    BookOpen, Users, UserCheck, Building, Cog,

    // 个人生活类
    Home, Heart, Coffee, Music, Camera, Palette, Gamepad2,
    ShoppingCart, Car, Plane, MapPin, Calendar,

    // 技术开发类
    Code, Terminal, Database, Server, Cpu, Globe,
    Smartphone, Monitor, Wifi, Cloud, GitBranch,

    // 学习教育类
    GraduationCap, Book, PenTool, Calculator, Microscope,
    Brain, Lightbulb, Award, Star, TrendingUp,

    // 通信社交类
    MessageCircle, Mail, Phone, Video, Users2, Share2,
    Megaphone, Radio, Headphones, Mic, MessageSquare, Hash, AtSign,

    // 健康生活类
    Zap, Sun, Moon, Leaf, Flower, TreePine,
    Activity, Heart as HeartHealth, Shield, Eye,

    // 财务金融类
    DollarSign, CreditCard, Wallet, TrendingDown,
    PieChart, BarChart3, Calculator as FinanceCalc,

    // 工具实用类
    Settings, Wrench, Scissors, Ruler, Compass,
    Lock, Key, Bell, Clock, Timer,

    // 抽象概念类
    Sparkles, Flame, Feather, Crown, Diamond,
    Infinity, Circle, Square, Triangle, Hexagon,

    // 新增图标 - 扩展覆盖范围
    // 媒体娱乐类
    Film, Tv, Image, PlayCircle, VolumeX, Volume2,
    // 文档办公类
    FileSpreadsheet, FileImage, File as FilePdf, Presentation, Clipboard,
    // 交通出行类
    Bike, Bus, Train, Ship, Rocket, Truck,
    // 自然环境类
    CloudRain, CloudSnow, Mountain, Waves, Sunrise, Sunset,
    // 运动健身类
    Dumbbell, Footprints, Trophy, Medal, Zap as Lightning,
    // 食物饮品类
    Utensils, Wine, Pizza, Apple, Cake,
    // 购物消费类
    Store, Tag, Gift, Package, CreditCard as Card,
    // 安全保护类
    ShieldCheck, Fingerprint, Scan, AlertTriangle, CheckCircle
} from 'lucide-react';

// 图标类别定义
export interface SpaceIconCategory {
    // 类别唯一标识
    id: string;
    // 类别显示名称
    name: string;
    // 类别描述
    description: string;
    // 该类别下的图标列表
    icons: SpaceIconItem[];
}

// 单个图标项定义
export interface SpaceIconItem {
    // 图标唯一标识（与Lucide组件名一致）
    id: string;
    // 图标显示名称
    name: string;
    // 图标描述
    description: string;
    // Lucide React组件
    component: React.ComponentType<any>;
    // 搜索关键词（支持中英文）
    keywords: string[];
}

// 完整的空间图标配置 - 包含所有80+个图标
export const spaceIconCategories: SpaceIconCategory[] = [
    {
        id: 'work',
        name: '工作项目',
        description: '适用于工作、项目管理、团队协作',
        icons: [
            { id: 'briefcase', name: '公文包', description: '商务工作、职业项目', component: Briefcase, keywords: ['工作', 'work', '商务', 'business'] },
            { id: 'folder-open', name: '打开文件夹', description: '项目管理、文档整理', component: FolderOpen, keywords: ['文件夹', 'folder', '项目', 'project'] },
            { id: 'folder', name: '文件夹', description: '分类整理、归档存储', component: Folder, keywords: ['文件夹', 'folder', '分类', 'category'] },
            { id: 'archive', name: '归档', description: '资料归档、历史项目', component: Archive, keywords: ['归档', 'archive', '历史', 'history'] },
            { id: 'file-text', name: '文档', description: '文档管理、文本整理', component: FileText, keywords: ['文档', 'document', '文本', 'text'] },
            { id: 'layers', name: '图层', description: '复杂项目、多层结构', component: Layers, keywords: ['图层', 'layers', '结构', 'structure'] },
            { id: 'target', name: '目标', description: '目标管理、KPI跟踪', component: Target, keywords: ['目标', 'target', 'goal', 'KPI'] },
            { id: 'book-open', name: '打开书籍', description: '学习资料、知识管理', component: BookOpen, keywords: ['书籍', 'book', '学习', 'learning'] },
            { id: 'users', name: '团队', description: '团队项目、协作工作', component: Users, keywords: ['团队', 'team', '协作', 'collaboration'] },
            { id: 'user-check', name: '用户验证', description: '用户管理、成员验证', component: UserCheck, keywords: ['用户', 'user', '验证', 'verify'] },
            { id: 'building', name: '公司', description: '企业项目、公司业务', component: Building, keywords: ['公司', 'company', '企业', 'enterprise'] },
            { id: 'cog', name: '设置', description: '系统配置、参数管理', component: Cog, keywords: ['设置', 'settings', '配置', 'config'] }
        ]
    },
    {
        id: 'personal',
        name: '个人生活',
        description: '日常生活、个人兴趣、休闲娱乐',
        icons: [
            { id: 'home', name: '家庭', description: '家庭事务、生活管理', component: Home, keywords: ['家庭', 'home', '生活', 'life'] },
            { id: 'heart', name: '爱好', description: '个人兴趣、喜爱收藏', component: Heart, keywords: ['爱好', 'hobby', '兴趣', 'interest'] },
            { id: 'coffee', name: '咖啡', description: '休闲时光、咖啡文化', component: Coffee, keywords: ['咖啡', 'coffee', '休闲', 'leisure'] },
            { id: 'music', name: '音乐', description: '音乐收藏、娱乐休闲', component: Music, keywords: ['音乐', 'music', '娱乐', 'entertainment'] },
            { id: 'camera', name: '摄影', description: '摄影作品、图片收集', component: Camera, keywords: ['摄影', 'photography', '相机', 'camera'] },
            { id: 'palette', name: '艺术', description: '艺术创作、设计灵感', component: Palette, keywords: ['艺术', 'art', '设计', 'design'] },
            { id: 'gamepad2', name: '游戏', description: '游戏娱乐、休闲时光', component: Gamepad2, keywords: ['游戏', 'game', '娱乐', 'entertainment'] },
            { id: 'shopping-cart', name: '购物', description: '购物清单、消费记录', component: ShoppingCart, keywords: ['购物', 'shopping', '消费', 'spending'] },
            { id: 'car', name: '汽车', description: '驾车出行、汽车管理', component: Car, keywords: ['汽车', 'car', '驾驶', 'driving'] },
            { id: 'plane', name: '飞机', description: '航空出行、长途旅行', component: Plane, keywords: ['飞机', 'plane', '航空', 'aviation'] },
            { id: 'map-pin', name: '地点', description: '地理位置、地点标记', component: MapPin, keywords: ['地点', 'location', '地理', 'geography'] },
            { id: 'calendar', name: '日历', description: '日程安排、时间管理', component: Calendar, keywords: ['日历', 'calendar', '日程', 'schedule'] },
            { id: 'pizza', name: '比萨', description: '快餐美食、休闲用餐', component: Pizza, keywords: ['比萨', 'pizza', '快餐', 'fastfood'] },
            { id: 'apple', name: '水果', description: '健康饮食、营养管理', component: Apple, keywords: ['水果', 'fruit', '健康', 'health'] },
            { id: 'utensils', name: '美食', description: '美食收藏、餐厅推荐', component: Utensils, keywords: ['美食', 'food', '餐厅', 'restaurant'] },
            { id: 'wine', name: '酒类', description: '酒类收藏、品酒记录', component: Wine, keywords: ['酒类', 'wine', '品酒', 'tasting'] },
            { id: 'cake', name: '甜点', description: '甜品制作、节日庆祝', component: Cake, keywords: ['蛋糕', 'cake', '甜品', 'dessert'] }
        ]
    },
    {
        id: 'tech',
        name: '技术开发',
        description: '编程开发、技术学习、IT工作',
        icons: [
            { id: 'code', name: '代码', description: '编程项目、代码管理', component: Code, keywords: ['代码', 'code', '编程', 'programming'] },
            { id: 'terminal', name: '终端', description: '命令行工具、系统管理', component: Terminal, keywords: ['终端', 'terminal', '命令行', 'command'] },
            { id: 'database', name: '数据库', description: '数据管理、数据库项目', component: Database, keywords: ['数据库', 'database', '数据', 'data'] },
            { id: 'server', name: '服务器', description: '服务器管理、部署运维', component: Server, keywords: ['服务器', 'server', '部署', 'deploy'] },
            { id: 'cpu', name: '处理器', description: '系统性能、硬件管理', component: Cpu, keywords: ['处理器', 'cpu', '性能', 'performance'] },
            { id: 'globe', name: '网络', description: '网络项目、Web开发', component: Globe, keywords: ['网络', 'network', 'web', '互联网'] },
            { id: 'smartphone', name: '移动端', description: '移动开发、APP项目', component: Smartphone, keywords: ['手机', 'mobile', 'app', '移动端'] },
            { id: 'monitor', name: '桌面端', description: '桌面应用、PC软件', component: Monitor, keywords: ['桌面', 'desktop', 'PC', '电脑'] },
            { id: 'wifi', name: '无线网络', description: '网络连接、无线通信', component: Wifi, keywords: ['网络', 'network', '无线', 'wireless'] },
            { id: 'cloud', name: '云服务', description: '云计算、云存储项目', component: Cloud, keywords: ['云', 'cloud', '云计算', '云存储'] },
            { id: 'git-branch', name: '版本控制', description: '代码管理、版本控制', component: GitBranch, keywords: ['git', '版本', 'version', '分支'] }
        ]
    },
    {
        id: 'education',
        name: '学习教育',
        description: '学习资料、教育项目、知识管理',
        icons: [
            { id: 'graduation-cap', name: '学历', description: '学习进度、教育经历', component: GraduationCap, keywords: ['学习', 'study', '教育', 'education'] },
            { id: 'book', name: '书籍', description: '读书笔记、文献资料', component: Book, keywords: ['书', 'book', '阅读', 'reading'] },
            { id: 'pen-tool', name: '笔记', description: '学习笔记、思维导图', component: PenTool, keywords: ['笔记', 'notes', '写作', 'writing'] },
            { id: 'calculator', name: '计算器', description: '数学计算、数据分析', component: Calculator, keywords: ['计算器', 'calculator', '数学', 'math'] },
            { id: 'microscope', name: '显微镜', description: '科学研究、细节分析', component: Microscope, keywords: ['显微镜', 'microscope', '科学', 'science'] },
            { id: 'brain', name: '思维', description: '思维训练、认知学习', component: Brain, keywords: ['思维', 'thinking', '大脑', 'brain'] },
            { id: 'lightbulb', name: '灵感', description: '创意想法、灵感收集', component: Lightbulb, keywords: ['灵感', 'inspiration', '创意', 'creativity'] },
            { id: 'award', name: '奖励', description: '成就认证、荣誉记录', component: Award, keywords: ['奖励', 'award', '荣誉', 'honor'] },
            { id: 'star', name: '收藏', description: '重要资料、精选内容', component: Star, keywords: ['收藏', 'favorite', '星标', 'star'] },
            { id: 'trending-up', name: '上升趋势', description: '进步记录、成长跟踪', component: TrendingUp, keywords: ['上升', 'trending', '进步', 'progress'] }
        ]
    },
    {
        id: 'communication',
        name: '通信交流',
        description: '通信工具、社交媒体、交流平台',
        icons: [
            { id: 'message-circle', name: '消息气泡', description: '即时通讯、聊天对话', component: MessageCircle, keywords: ['消息', 'message', '聊天', 'chat'] },
            { id: 'mail', name: '邮件', description: '电子邮件、邮件管理', component: Mail, keywords: ['邮件', 'email', '邮箱', 'mailbox'] },
            { id: 'phone', name: '电话', description: '电话通讯、联系方式', component: Phone, keywords: ['电话', 'phone', '通话', 'call'] },
            { id: 'video', name: '视频通话', description: '视频会议、远程通讯', component: Video, keywords: ['视频', 'video', '会议', 'meeting'] },
            { id: 'users2', name: '社交网络', description: '社交平台、人脉网络', component: Users2, keywords: ['社交', 'social', '网络', 'network'] },
            { id: 'share2', name: '分享', description: '内容分享、社交传播', component: Share2, keywords: ['分享', 'share', '传播', 'spread'] },
            { id: 'megaphone', name: '广播', description: '公告通知、宣传推广', component: Megaphone, keywords: ['广播', 'broadcast', '公告', 'announcement'] },
            { id: 'radio', name: '电台', description: '电台节目、音频内容', component: Radio, keywords: ['电台', 'radio', '音频', 'audio'] },
            { id: 'headphones', name: '耳机', description: '音频体验、私人收听', component: Headphones, keywords: ['耳机', 'headphones', '音频', 'audio'] },
            { id: 'mic', name: '麦克风', description: '录音记录、语音输入', component: Mic, keywords: ['麦克风', 'microphone', '录音', 'recording'] },
            { id: 'message-square', name: '讨论社区', description: '论坛讨论、社区交流', component: MessageSquare, keywords: ['讨论', 'discussion', '社区', 'community'] },
            { id: 'hash', name: '话题标签', description: '热门话题、内容标签', component: Hash, keywords: ['标签', 'hashtag', '话题', 'topic'] },
            { id: 'at-sign', name: '提及通知', description: '用户交互、提及通知', component: AtSign, keywords: ['提及', 'mention', '通知', 'notification'] }
        ]
    },
    {
        id: 'health',
        name: '健康生活',
        description: '健康管理、生活方式、环境优化',
        icons: [
            { id: 'zap', name: '闪电', description: '能量爆发、高效行动', component: Zap, keywords: ['闪电', 'zap', '能量', 'energy'] },
            { id: 'sun', name: '太阳', description: '阳光生活、积极态度', component: Sun, keywords: ['太阳', 'sun', '阳光', 'sunshine'] },
            { id: 'moon', name: '月亮', description: '夜间模式、宁静时刻', component: Moon, keywords: ['月亮', 'moon', '夜间', 'night'] },
            { id: 'leaf', name: '叶子', description: '绿色生活、环保理念', component: Leaf, keywords: ['叶子', 'leaf', '绿色', 'green'] },
            { id: 'flower', name: '花朵', description: '美好生活、艺术美学', component: Flower, keywords: ['花朵', 'flower', '美好', 'beautiful'] },
            { id: 'tree-pine', name: '松树', description: '自然环境、持久成长', component: TreePine, keywords: ['松树', 'pine', '自然', 'nature'] },
            { id: 'activity', name: '活动', description: '运动记录、健康数据', component: Activity, keywords: ['活动', 'activity', '运动', 'exercise'] },
            { id: 'heart-health', name: '心理健康', description: '情绪管理、心理健康', component: HeartHealth, keywords: ['心理', 'mental', '健康', 'health'] },
            { id: 'shield', name: '保护', description: '安全防护、隐私保护', component: Shield, keywords: ['保护', 'protect', '安全', 'security'] },
            { id: 'eye', name: '眼睛', description: '观察跟踪、目标监控', component: Eye, keywords: ['眼睛', 'eye', '观察', 'observe'] },
            { id: 'dumbbell', name: '健身', description: '健身训练、力量训练', component: Dumbbell, keywords: ['健身', 'fitness', '训练', 'training'] },
            { id: 'footprints', name: '脚印', description: '步行跟踪、运动记录', component: Footprints, keywords: ['脚印', 'footprints', '步行', 'walking'] },
            { id: 'trophy', name: '奖杯', description: '成就记录、竞赛奖励', component: Trophy, keywords: ['奖杯', 'trophy', '成就', 'achievement'] },
            { id: 'medal', name: '奖章', description: '荣誉记录、优秀表现', component: Medal, keywords: ['奖章', 'medal', '荣誉', 'honor'] },
            { id: 'lightning', name: '雷电', description: '爆发力量、瞬间能量', component: Lightning, keywords: ['雷电', 'lightning', '爆发', 'burst'] }
        ]
    },
    {
        id: 'finance',
        name: '财务金融',
        description: '财务管理、投资理财、数据分析',
        icons: [
            { id: 'dollar-sign', name: '金钱', description: '财务管理、收入记录', component: DollarSign, keywords: ['金钱', 'money', '财务', 'finance'] },
            { id: 'credit-card', name: '信用卡', description: '支付管理、消费记录', component: CreditCard, keywords: ['信用卡', 'credit', '支付', 'payment'] },
            { id: 'wallet', name: '钱包', description: '钱包管理、现金流水', component: Wallet, keywords: ['钱包', 'wallet', '现金', 'cash'] },
            { id: 'trending-down', name: '下降趋势', description: '损失分析、风险控制', component: TrendingDown, keywords: ['下降', 'decline', '损失', 'loss'] },
            { id: 'pie-chart', name: '饼图', description: '数据分析、比例展示', component: PieChart, keywords: ['饼图', 'pie chart', '数据', 'data'] },
            { id: 'bar-chart3', name: '柱状图', description: '统计图表、数据对比', component: BarChart3, keywords: ['柱状图', 'bar chart', '统计', 'statistics'] },
            { id: 'finance-calc', name: '金融计算', description: '金融计算、投资分析', component: FinanceCalc, keywords: ['计算', 'calculation', '金融', 'finance'] }
        ]
    },
    {
        id: 'tools',
        name: '工具实用',
        description: '实用工具、系统管理、效率提升',
        icons: [
            { id: 'settings', name: '设置', description: '系统配置、参数管理', component: Settings, keywords: ['设置', 'settings', '配置', 'config'] },
            { id: 'wrench', name: '维修', description: '维护工具、故障处理', component: Wrench, keywords: ['维修', 'repair', '工具', 'tools'] },
            { id: 'scissors', name: '剪刀', description: '剪辑工具、编辑功能', component: Scissors, keywords: ['剪刀', 'scissors', '剪辑', 'cut'] },
            { id: 'ruler', name: '尺子', description: '测量工具、精确尺寸', component: Ruler, keywords: ['尺子', 'ruler', '测量', 'measure'] },
            { id: 'compass', name: '指南针', description: '方向导航、目标定位', component: Compass, keywords: ['指南针', 'compass', '方向', 'direction'] },
            { id: 'lock', name: '安全', description: '安全管理、隐私保护', component: Lock, keywords: ['安全', 'security', '锁', 'lock'] },
            { id: 'key', name: '钥匙', description: '密码管理、权限控制', component: Key, keywords: ['钥匙', 'key', '密码', 'password'] },
            { id: 'bell', name: '通知', description: '提醒事项、通知管理', component: Bell, keywords: ['通知', 'notification', '提醒', 'reminder'] },
            { id: 'clock', name: '时间', description: '时间管理、日程安排', component: Clock, keywords: ['时间', 'time', '时钟', 'clock'] },
            { id: 'timer', name: '计时器', description: '时间控制、倒计时', component: Timer, keywords: ['计时器', 'timer', '倒计时', 'countdown'] },
            { id: 'clipboard', name: '剪贴板', description: '任务清单、备忘录', component: Clipboard, keywords: ['剪贴板', 'clipboard', '清单', 'list'] },
            { id: 'scan', name: '扫描', description: '文档扫描、信息检索', component: Scan, keywords: ['扫描', 'scan', '检索', 'search'] },
            { id: 'shield-check', name: '安全检查', description: '安全验证、保护机制', component: ShieldCheck, keywords: ['安全', 'security', '验证', 'verify'] },
            { id: 'check-circle', name: '完成', description: '任务完成、确认状态', component: CheckCircle, keywords: ['完成', 'complete', '确认', 'confirm'] }
        ]
    },
    {
        id: 'media',
        name: '媒体娱乐',
        description: '影音娱乐、多媒体内容、创意设计',
        icons: [
            { id: 'film', name: '电影', description: '电影收藏、影视项目', component: Film, keywords: ['电影', 'film', '视频', 'video'] },
            { id: 'tv', name: '电视', description: '电视剧集、节目收藏', component: Tv, keywords: ['电视', 'tv', '节目', 'show'] },
            { id: 'image', name: '图片', description: '图片收藏、素材管理', component: Image, keywords: ['图片', 'image', '图像', 'picture'] },
            { id: 'play-circle', name: '播放', description: '媒体播放、娱乐内容', component: PlayCircle, keywords: ['播放', 'play', '媒体', 'media'] },
            { id: 'volume-x', name: '静音', description: '静音模式、无声环境', component: VolumeX, keywords: ['静音', 'mute', '无声', 'silent'] },
            { id: 'volume-2', name: '音频', description: '音频文件、声音管理', component: Volume2, keywords: ['音频', 'audio', '声音', 'sound'] },
            { id: 'file-spreadsheet', name: '表格', description: '电子表格、数据统计', component: FileSpreadsheet, keywords: ['表格', 'spreadsheet', '数据', 'data'] },
            { id: 'file-image', name: '图片文件', description: '图片处理、视觉素材', component: FileImage, keywords: ['图片', 'image', '文件', 'file'] },
            { id: 'file-pdf', name: 'PDF文档', description: 'PDF文件、正式文档', component: FilePdf, keywords: ['pdf', '文档', 'document', '正式'] },
            { id: 'presentation', name: '演示', description: '演示文稿、展示项目', component: Presentation, keywords: ['演示', 'presentation', '幻灯片', 'slides'] }
        ]
    },
    {
        id: 'travel',
        name: '出行交通',
        description: '交通工具、旅行计划、出行管理',
        icons: [
            { id: 'bike', name: '骑行', description: '骑行路线、运动记录', component: Bike, keywords: ['骑行', 'bike', '自行车', 'bicycle'] },
            { id: 'bus', name: '公交车', description: '公共交通、通勤路线', component: Bus, keywords: ['公交', 'bus', '交通', 'transport'] },
            { id: 'train', name: '火车', description: '火车旅行、铁路出行', component: Train, keywords: ['火车', 'train', '铁路', 'railway'] },
            { id: 'ship', name: '轮船', description: '海上旅行、水上交通', component: Ship, keywords: ['轮船', 'ship', '海上', 'sea'] },
            { id: 'rocket', name: '火箭', description: '快速启动、创新项目', component: Rocket, keywords: ['火箭', 'rocket', '快速', 'fast'] },
            { id: 'truck', name: '卡车', description: '货运物流、重型运输', component: Truck, keywords: ['卡车', 'truck', '货运', 'freight'] }
        ]
    },
    {
        id: 'nature',
        name: '自然环境',
        description: '自然景观、环境保护、户外活动',
        icons: [
            { id: 'cloud-rain', name: '雨云', description: '雨天天气、雨水记录', component: CloudRain, keywords: ['雨云', 'cloud', '雨', 'rain'] },
            { id: 'cloud-snow', name: '雪云', description: '雪天天气、冬季记录', component: CloudSnow, keywords: ['雪云', 'snow', '雪', '冬季'] },
            { id: 'mountain', name: '山峰', description: '挑战目标、高度成就', component: Mountain, keywords: ['山峰', 'mountain', '挑战', 'challenge'] },
            { id: 'waves', name: '波浪', description: '流动变化、动态过程', component: Waves, keywords: ['波浪', 'waves', '流动', 'flow'] },
            { id: 'sunrise', name: '日出', description: '新的开始、希望象征', component: Sunrise, keywords: ['日出', 'sunrise', '开始', 'start'] },
            { id: 'sunset', name: '日落', description: '结束时刻、宁静美好', component: Sunset, keywords: ['日落', 'sunset', '结束', 'end'] }
        ]
    },
    {
        id: 'shopping',
        name: '购物消费',
        description: '购物清单、商店管理、消费记录',
        icons: [
            { id: 'store', name: '商店', description: '商店管理、购物地点', component: Store, keywords: ['商店', 'store', '购物', 'shopping'] },
            { id: 'tag', name: '标签', description: '价格标签、优惠信息', component: Tag, keywords: ['标签', 'tag', '价格', 'price'] },
            { id: 'gift', name: '礼物', description: '特殊收藏、珍贵资源', component: Gift, keywords: ['礼物', 'gift', '特殊', 'special'] },
            { id: 'package', name: '包裹', description: '快递包裹、物流追踪', component: Package, keywords: ['包裹', 'package', '快递', 'delivery'] },
            { id: 'card', name: '会员卡', description: '会员卡管理、积分记录', component: Card, keywords: ['会员卡', 'card', '积分', 'points'] }
        ]
    },
    {
        id: 'security',
        name: '安全保护',
        description: '安全验证、隐私保护、系统安全',
        icons: [
            { id: 'fingerprint', name: '指纹', description: '生物识别、安全验证', component: Fingerprint, keywords: ['指纹', 'fingerprint', '生物', 'bio'] },
            { id: 'alert-triangle', name: '警告', description: '安全警告、风险提示', component: AlertTriangle, keywords: ['警告', 'alert', '风险', 'risk'] }
        ]
    },
    {
        id: 'creative',
        name: '创意抽象',
        description: '抽象概念、创意符号、装饰图标',
        icons: [
            { id: 'sparkles', name: '闪亮', description: '特殊项目、重点内容', component: Sparkles, keywords: ['闪亮', 'sparkles', '特殊', 'special'] },
            { id: 'flame', name: '热门', description: '热点话题、活跃项目', component: Flame, keywords: ['火', 'flame', '热门', 'hot'] },
            { id: 'feather', name: '羽毛', description: '轻盈灵动、創意灵感', component: Feather, keywords: ['羽毛', 'feather', '轻盈', 'light'] },
            { id: 'crown', name: '王冠', description: '重要项目、高优先级', component: Crown, keywords: ['王冠', 'crown', '重要', 'important'] },
            { id: 'diamond', name: '钻石', description: '珍贵资料、精品收藏', component: Diamond, keywords: ['钻石', 'diamond', '珍贵', 'precious'] },
            { id: 'infinity', name: '无限', description: '无限潜能、永无止境', component: Infinity, keywords: ['无限', 'infinity', '永无', 'endless'] },
            { id: 'circle', name: '圆形', description: '简洁标识、基础分类', component: Circle, keywords: ['圆', 'circle', '简洁', 'simple'] },
            { id: 'square', name: '方形', description: '规整分类、标准格式', component: Square, keywords: ['方形', 'square', '规整', 'regular'] },
            { id: 'triangle', name: '三角形', description: '稳定结构、关键要素', component: Triangle, keywords: ['三角形', 'triangle', '稳定', 'stable'] },
            { id: 'hexagon', name: '六角形', description: '完美对称、高效结构', component: Hexagon, keywords: ['六角形', 'hexagon', '对称', 'symmetric'] }
        ]
    }
];

// 获取所有图标的扁平化列表
export const getAllSpaceIcons = (): SpaceIconItem[] => {
    return spaceIconCategories.flatMap(category => category.icons);
};

// 根据图标ID获取图标项
export const getSpaceIconById = (iconId: string): SpaceIconItem | undefined => {
    return getAllSpaceIcons().find(icon => icon.id === iconId);
};

// 搜索图标（支持中英文关键词）
export const searchSpaceIcons = (query: string): SpaceIconItem[] => {
    if (!query.trim()) return getAllSpaceIcons();

    const searchTerm = query.toLowerCase().trim();
    return getAllSpaceIcons().filter(icon =>
        icon.keywords.some(keyword => keyword.toLowerCase().includes(searchTerm)) ||
        icon.name.toLowerCase().includes(searchTerm) ||
        icon.description.toLowerCase().includes(searchTerm)
    );
};

// 默认图标ID
export const DEFAULT_SPACE_ICON = 'folder';

// ============================================================
// 工具函数：图标颜色推导
// ============================================================

// 预定义一组高频使用职业/场景的推荐颜色（尽量语义化）
const ICON_COLOR_PALETTE: Record<string, string> = {
    // 代码/技术相关图标默认蓝色系（突出理性、专业）
    code: '#2563eb',
    terminal: '#1d4ed8',
    server: '#1e40af',
    database: '#1e3a8a',
    // 文档/组织类使用中性色
    folder: '#334155',
    'folder-open': '#475569',
    file: '#475569',
    'file-text': '#475569',
    // 进度/目标类使用强调色
    target: '#dc2626',
    trophy: '#d97706',
    award: '#d97706',
    // 创意/灵感类使用紫色系
    sparkles: '#7e22ce',
    lightbulb: '#7e22ce',
    palette: '#9333ea',
    // 沟通/协作使用青色系
    'message-circle': '#0d9488',
    users: '#0f766e',
    mail: '#0e7490',
};

// 根据已有图标选择一个合理的颜色
const pickIconColor = (icon: string): string => {
    // 如果有预设颜色则直接返回
    if (ICON_COLOR_PALETTE[icon]) return ICON_COLOR_PALETTE[icon];
    // 否则对 icon 字符串做简单哈希映射到一组保底颜色池
    const fallback = ['#2563eb', '#0d9488', '#9333ea', '#dc2626', '#d97706', '#334155'];
    let hash = 0;
    for (let i = 0; i < icon.length; i++) hash = (hash * 31 + icon.charCodeAt(i)) >>> 0;
    return fallback[hash % fallback.length];
};

/**
 * 根据图标名称推导合适的颜色
 * @param icon - 图标名称（Lucide 图标 ID）
 * @returns 推荐的十六进制颜色值
 */
export const getSpaceIconColor = (icon: string): string => pickIconColor(icon);

// ============================================================
// 推荐空间颜色列表
// ============================================================

/**
 * 推荐的空间颜色列表（供颜色选择器使用）
 * 基于现代 UI 设计趋势（2024-2025）
 */
export const RECOMMENDED_SPACE_COLORS: string[] = [
    // 现代数字薰衣草和温和紫系（2024-2025主色调）
    '#a78bfa', '#8b5cf6', '#7c3aed',
    // 宁静蓝绿系（现代Web主流）
    '#06b6d4', '#0891b2', '#0e7490',
    // 温暖舒适色系（蜂蜜中性 + 深度自然）
    '#f59e0b', '#d97706', '#b45309',
    // 活力点缀色（珊瑚 + 霓虹活力）
    '#f97316', '#ea580c', '#ec4899',
    // 大胆电子蓝
    '#3b82f6', '#2563eb',
    // 深度自然绿（森林 + 青翠）
    '#059669', '#0d9488',
    // 红色点缀（不作主色使用）
    '#dc2626', '#ef4444',
    // 现代中性色（米色 + 石墨）
    '#64748b', '#475569', '#334155'
];
